package com.yeban.base.day03;

import java.util.Scanner;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/9/27
 */
public class For_work03 {

    public static void main(String[] args) {

        // 提示输入一个信息
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个数字：");
        int n = sc.nextInt();

        // 判断是否为水仙花数
        int number = n;
        int temp = 0;
        int sum = 0;
        for (int i = 0; i < 3; i++) {
            temp = n % 10;
            sum += temp * temp * temp;
            n /= 10;
        }

        if (sum == number) {
            System.out.println("这个数是水仙花数！");
        } else {
            System.out.println("这个数不是水仙花数！");
        }

    }
}
